home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / gus / vts139b.zip / VTWINS.PAS < prev   
Pascal/Delphi Source File  |  1993-12-22  |  22KB  |  678 lines

  1. UNIT VTWins;
  2.  
  3. INTERFACE
  4.  
  5. USES VTGlobal, VTStrConst, StrConst,
  6.      SoundDevices, SongUnit, SongElements, PlayMod,
  7.      Output43, Vid43, Kbd;
  8.  
  9.  
  10. TYPE
  11.   TChWindows = ARRAY[1..4] OF TWindow;
  12.  
  13. CONST
  14.  
  15.   { 0 -> 0 }
  16.   { 1 -> 3 }
  17.   { 2 -> 7 }
  18.   { 3 -> 4 }
  19.   { 4 -> 2 }
  20.   { 5 -> 1 }
  21.   { 6 -> 5 }
  22.   { 7 -> 6 }
  23.  
  24.  
  25.   EmptyPalet        = #$30;
  26.  
  27.   ScreenPalet       = #$35#$75#$34;
  28.  
  29.   F8Palet           = #$03#$04#$03;
  30.  
  31.   RunInfoPalet      = #$31#$06#$30#$47;
  32.   MiscInfoPalet     = #$31#$06;
  33.   LabelPalet        = #$31#$64;
  34.  
  35.   ChannelNumPalet   = #$17;
  36.   RunSamplePalet    = #$30;
  37.   InfoNotePalet     = #$36#$17#$06;
  38.   PlayBarsPalet     = #$05#$02#$04;
  39.  
  40.   MenusPalet        = #$35#$75#$34;
  41.   OscilloscPalet    = #$34#$5F;
  42.   SamplesPalet      = #$30#$36#$06#$07#$07#$16#$47#$64;
  43.  
  44.   PartPalet         = #$82#$07#$30#$17;
  45.  
  46.   CreditsPalet      = #$31#$37#$34;
  47.  
  48.  
  49.   wF8Demo      : TWindow = (x: 0; y:-1; w:90; h:26; col: F8Palet;        vis:FALSE; forz:FALSE; act:FALSE);
  50.   wF8DemoUp    : TWindow = (x: 0; y: 0; w:90; h:11; col: ScreenPalet;    vis:FALSE; forz:FALSE; act:FALSE);
  51.   wF8DemoDown  : TWindow = (x: 0; y:25; w:90; h:16; col: ScreenPalet;    vis:FALSE; forz:FALSE; act:FALSE);
  52.  
  53.   wScreen      : TWindow = (x: 0; y: 0; w:90; h:63; col: ScreenPalet;    vis:FALSE; forz:FALSE; act:FALSE);
  54.  
  55.   wTopLine     : TWindow = (x: 0; y: 0; w:90; h: 6; col: EmptyPalet;     vis:FALSE; forz:FALSE; act:FALSE);
  56.   wRunInfo     : TWindow = (x: 0; y: 0; w:24; h: 6; col: RunInfoPalet;   vis:FALSE; forz:FALSE; act:FALSE);
  57.   wMiscInfo    : TWindow = (x:23; y: 0; w:57; h: 6; col: MiscInfoPalet;  vis:FALSE; forz:FALSE; act:FALSE);
  58.   wLabel       : TWindow = (x:69; y: 0; w:21; h: 6; col: LabelPalet;     vis:FALSE; forz:FALSE; act:FALSE);
  59.  
  60.   w2ndLine     : TWindow = (x: 0; y: 5; w:90; h:18; col: EmptyPalet;     vis:FALSE; forz:FALSE; act:FALSE);
  61.   wChannelNum  : TWindow = (x: 0; y: 5; w: 5; h:18; col: ChannelNumPalet;vis:FALSE; forz:FALSE; act:FALSE);
  62.   wRunSample   : TWindow = (x: 3; y: 5; w:30; h:18; col: RunSamplePalet; vis:FALSE; forz:FALSE; act:FALSE);
  63.   wInfoNote    : TWindow = (x:32; y: 5; w:30; h:18; col: InfoNotePalet;  vis:FALSE; forz:FALSE; act:FALSE);
  64.   wPlayBars    : TWindow = (x:61; y: 5; w:18; h:18; col: PlayBarsPalet;  vis:FALSE; forz:FALSE; act:FALSE);
  65.   wPanning     : TWindow = (x:78; y: 5; w: 8; h:18; col: EmptyPalet;     vis:FALSE; forz:FALSE; act:FALSE);
  66.   wVoiceOnOff  : TWindow = (x:85; y: 5; w: 5; h:18; col: EmptyPalet;     vis:FALSE; forz:FALSE; act:FALSE);
  67.  
  68.  
  69.   wMenus       : TWindow = (x: 0; y:22; w:90; h:22; col: MenusPalet;     vis:FALSE; forz:FALSE; act:FALSE);
  70.   wOscillosc   : TWindow = (x: 0; y:22; w:90; h:22; col: OscilloscPalet; vis:FALSE; forz:FALSE; act:FALSE);
  71.   wSamples     : TWindow = (x: 0; y:22; w:90; h:22; col: SamplesPalet;   vis:FALSE; forz:FALSE; act:FALSE);
  72.   wSamples1    : TWindow = (x: 1; y:22; w:30; h:22; col: SamplesPalet;   vis:FALSE; forz:FALSE; act:FALSE);
  73.   wSamples2    : TWindow = (x:30; y:22; w:30; h:22; col: SamplesPalet;   vis:FALSE; forz:FALSE; act:FALSE);
  74.   wSamples3    : TWindow = (x:59; y:22; w:30; h:22; col: SamplesPalet;   vis:FALSE; forz:FALSE; act:FALSE);
  75.  
  76.   wPartSmall   : TWindow = (x: 0; y:43; w:90; h:20; col: EmptyPalet;     vis:FALSE; forz:FALSE; act:FALSE);
  77.   wPartPastIdx : TWindow = (x: 0; y:43; w: 5; h: 9; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE);
  78.   wPartPast    : TChWindows = (
  79.                            (x: 5; y:43; w:22; h: 9; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE),
  80.                            (x:26; y:43; w:22; h: 9; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE),
  81.                            (x:47; y:43; w:22; h: 9; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE),
  82.                            (x:68; y:43; w:22; h: 9; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE)
  83.                  );
  84.   wPartActIdx  : TWindow = (x: 0; y:51; w: 5; h: 4; col: EmptyPalet;     vis:FALSE; forz:FALSE; act:FALSE);
  85.   wPartAct     : TChWindows = (
  86.                            (x: 5; y:51; w:22; h: 4; col: EmptyPalet;     vis:FALSE; forz:FALSE; act:FALSE),
  87.                            (x:26; y:51; w:22; h: 4; col: EmptyPalet;     vis:FALSE; forz:FALSE; act:FALSE),
  88.                            (x:47; y:51; w:22; h: 4; col: EmptyPalet;     vis:FALSE; forz:FALSE; act:FALSE),
  89.                            (x:68; y:51; w:22; h: 4; col: EmptyPalet;     vis:FALSE; forz:FALSE; act:FALSE)
  90.                  );
  91.   wPartFutIdx  : TWindow = (x: 0; y:54; w: 5; h: 9; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE);
  92.   wPartFut     : TChWindows = (
  93.                            (x: 5; y:54; w:22; h: 9; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE),
  94.                            (x:26; y:54; w:22; h: 9; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE),
  95.                            (x:47; y:54; w:22; h: 9; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE),
  96.                            (x:68; y:54; w:22; h: 9; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE)
  97.                  );
  98.  
  99.   wPartBig     : TWindow = (x: 0; y: 5; w:90; h:58; col: EmptyPalet;     vis:FALSE; forz:FALSE; act:FALSE);
  100.   wPartPastBIdx: TWindow = (x: 0; y: 5; w: 5; h:28; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE);
  101.   wPartPastBig : TChWindows = (
  102.                            (x: 5; y: 5; w:22; h:28; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE),
  103.                            (x:26; y: 5; w:22; h:28; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE),
  104.                            (x:47; y: 5; w:22; h:28; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE),
  105.                            (x:68; y: 5; w:22; h:28; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE)
  106.                  );
  107.   wPartActBIdx : TWindow = (x: 0; y:32; w: 5; h: 4; col: EmptyPalet;     vis:FALSE; forz:FALSE; act:FALSE);
  108.   wPartActBig  : TChWindows = (
  109.                            (x: 5; y:32; w:22; h: 4; col: EmptyPalet;     vis:FALSE; forz:FALSE; act:FALSE),
  110.                            (x:26; y:32; w:22; h: 4; col: EmptyPalet;     vis:FALSE; forz:FALSE; act:FALSE),
  111.                            (x:47; y:32; w:22; h: 4; col: EmptyPalet;     vis:FALSE; forz:FALSE; act:FALSE),
  112.                            (x:68; y:32; w:22; h: 4; col: EmptyPalet;     vis:FALSE; forz:FALSE; act:FALSE)
  113.                  );
  114.   wPartFutBIdx : TWindow = (x: 0; y:35; w: 5; h:28; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE);
  115.   wPartFutBig  : TChWindows = (
  116.                            (x: 5; y:35; w:22; h:28; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE),
  117.                            (x:26; y:35; w:22; h:28; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE),
  118.                            (x:47; y:35; w:22; h:28; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE),
  119.                            (x:68; y:35; w:22; h:28; col: PartPalet;      vis:FALSE; forz:FALSE; act:FALSE)
  120.                  );
  121.   wCredits     : TWindow = (x: 0; y: 5; w:90; h:58; col: CreditsPalet;   vis:FALSE; forz:FALSE; act:FALSE);
  122.  
  123. CONST
  124.   BarVal : CHAR = '▒';   { '▒', 'ª', 'ÿ' }
  125.  
  126.   FirstChannel : BYTE = 1;
  127.  
  128. VAR
  129.   wriX1, wriX2,
  130.   wmiX1, wmiX2, wmiX3,
  131.   winX1, winX2, winX3, winX4, winX5,
  132.   wsX1                              : WORD;
  133.  
  134.  
  135.  
  136. PROCEDURE InitWinF8Demo;
  137. PROCEDURE InitWinF8Line;
  138. PROCEDURE InitWinScreen;
  139. PROCEDURE InitWinTopLine;
  140. PROCEDURE InitWin2ndLine;
  141. PROCEDURE InitWinMenus;
  142. PROCEDURE InitWinOscillosc;
  143. PROCEDURE InitWinSamples;
  144. PROCEDURE InitWinPart;
  145. PROCEDURE InitWinBigPart;
  146. PROCEDURE InitWinCredits;
  147.  
  148. PROCEDURE InitScreen;
  149.  
  150. PROCEDURE RefreshMiscInfo   (VAR Song: TSong);
  151. PROCEDURE RefreshModuleInfo (VAR Song: TSong);
  152.  
  153.  
  154.  
  155.  
  156. IMPLEMENTATION
  157.  
  158. USES Objects, Heaps, HexConversions;
  159.  
  160.  
  161.  
  162.  
  163. PROCEDURE InitWinF8Demo;
  164.   VAR
  165.     i       : WORD;
  166.     SaveOfs : WORD;
  167.     Spaces  : STRING[90];
  168.   BEGIN
  169.     SaveOfs   := ScrOffset;
  170.     ScrOffset := 0;
  171.  
  172.     ClearScreen;
  173.     PutWindowBigFrame(wF8Demo);
  174.  
  175.     WITH wF8Demo DO
  176.       BEGIN
  177.  
  178.         FillChar(Spaces, SIZEOF(Spaces), ' ');
  179.         Spaces[0] := #90;
  180.  
  181.         FOR i := 0 TO 26 DO
  182.           DirectWriteAttr(ParseCoords(0, i), Spaces, BYTE(Col[3]));
  183.  
  184.         PutWindowBigFrame(wF8DemoDown);
  185.  
  186.         DirectWriteAttr(ParseCoords(27, 4), 'Demo de ventanas  en el VT', BYTE(Col[3]));
  187.         DirectWriteAttr(ParseCoords(35, 6), '¿Te gusta?',                 BYTE(Col[3]));
  188.  
  189.         DirectWriteAttr(ParseCoords(7, 10),
  190.           'En la próxima versión se supone que aquí podrás hacer el Shell.',                 BYTE(Col[2]));
  191.       END;
  192.  
  193.     ScrOffset := SaveOfs;
  194.   END;
  195.  
  196.  
  197. PROCEDURE InitWinF8Line;
  198.   BEGIN
  199.     PutWindowBigFrame(wF8DemoUp);
  200.   END;
  201.  
  202.  
  203. PROCEDURE InitWinScreen;
  204.   BEGIN
  205.     ClearScreen;
  206.     PutWindowBigFrame(wScreen);
  207.   END;
  208.  
  209.  
  210. PROCEDURE InitWinRunInfo;
  211.   BEGIN
  212.     PutWindow(wRunInfo);
  213.  
  214.     WITH wRunInfo DO BEGIN
  215.       vis  := FALSE;
  216.       forz := FALSE;
  217.       act  := FALSE;
  218.  
  219.       wriX1 := 12;
  220.       wriX2 := 16;
  221.       DirectWrite     (ParseCoords(x+ 1, y+1), GetString(StrPosition));
  222.       DirectWrite     (ParseCoords(x+ 1, y+2), GetString(StrPattern));
  223.       DirectWrite     (ParseCoords(x+ 1, y+3), GetString(StrNote));
  224.       DirectWrite     (ParseCoords(x+ 1, y+4), GetString(StrTempo));
  225.       DirectWriteAttr (ParseCoords(x+wriX2-1, y+1), '/',   BYTE(col[3]));
  226.       DirectWriteAttr (ParseCoords(x+wriX2-1, y+2), '/',   BYTE(col[3]));
  227.       DirectWriteAttr (ParseCoords(x+wriX2-1, y+3), '/',   BYTE(col[3]));
  228.       DirectWriteAttr (ParseCoords(x+wriX2-1, y+4), 'B',   BYTE(col[3]));
  229.       RectAttr        (ParseCoords(x+wriX2,   y+1), 3, 4,  BYTE(col[2]));
  230.       RectAttr        (ParseCoords(x+wriX1,   y+1), 3, 4,  BYTE(col[2]));
  231.       DirectWriteAttr (ParseCoords(x+wriX2+4, y+4), 'F',   BYTE(col[3]));
  232.       DirectWriteAttr (ParseCoords(x+wriX2+5, y+4), '  ',  BYTE(col[2]));
  233.     END;
  234.   END;
  235.  
  236.  
  237. PROCEDURE InitWinMiscInfo;
  238.   BEGIN
  239.     PutWindow(wMiscInfo);
  240.  
  241.     WITH wMiscInfo DO BEGIN
  242.       DirectWrite (ParseCoords(x+1,  y+1), GetString(StrModule));
  243.       DirectWrite (ParseCoords(x+1,  y+2), GetString(StrFilename));
  244.       DirectWrite (ParseCoords(x+1,  y+3), GetString(StrMemoryLeft));
  245.       DirectWrite (ParseCoords(x+1,  y+4), GetString(StrSampleRate));
  246.       DirectWrite (ParseCoords(x+18, y+4), GetString(StrVolume));
  247.       wmiX1 := 12;
  248.       wmiX2 := 25;
  249.       wmiX3 := 26;
  250.       DirectWrite (ParseCoords(x+wmiX2-1, y+2), '/');
  251.       RectAttr    (ParseCoords(x+wmiX1, y+1), 20,         1, BYTE(col[2]));
  252.       RectAttr    (ParseCoords(x+wmiX1, y+2), 12,         1, BYTE(col[2]));
  253.       RectAttr    (ParseCoords(x+wmiX2, y+2), 12,         1, BYTE(col[2]));
  254.       RectAttr    (ParseCoords(x+wmiX1, y+3), 21,         1, BYTE(col[2]));
  255.       RectAttr    (ParseCoords(x+wmiX1, y+4), 5,          1, BYTE(col[2]));
  256.       RectAttr    (ParseCoords(x+wmiX3, y+4), 3,          1, BYTE(col[2]));
  257.     END;
  258.   END;
  259.  
  260.  
  261. PROCEDURE InitWinLabel;
  262.   BEGIN
  263.     PutWindow(wLabel);
  264.  
  265.     WITH wLabel DO BEGIN
  266.       RectAttr    (ParseCoords(x+2, y+2), 17, 2, BYTE(col[2]));
  267.       DirectWrite (ParseCoords(x+3, y+2), 'Vangeli⌐¬racker');
  268.       DirectWrite (ParseCoords(x+4, y+3), NoBetaPadding+Version+BetaPadStr);
  269.     END;
  270.   END;
  271.  
  272.  
  273. PROCEDURE InitWinTopLine;
  274.   BEGIN
  275.     InitWinRunInfo;
  276.     InitWinMiscInfo;
  277.     InitWinLabel;
  278.   END;
  279.  
  280.  
  281. PROCEDURE InitWinChannelNum;
  282.   CONST
  283.     s : STRING[2] = '  ';
  284.   VAR
  285.     i : WORD;
  286.   BEGIN
  287.     PutWindow(wChannelNum);
  288.  
  289.     WITH wChannelNum DO
  290.       FOR i := 1 TO 16 DO
  291.         BEGIN
  292.           IF i = 10 THEN s[1] := '1';
  293.           s[2] := CHAR(i MOD 10 + ORD('0'));
  294.           DirectWrite(ParseCoords(x+1, y+i), s);
  295.         END;
  296.   END;
  297.  
  298.  
  299. PROCEDURE InitWinRunSample;
  300.   BEGIN
  301.     PutWindow(wRunSample);
  302.   END;
  303.  
  304.  
  305. PROCEDURE InitWinInfoNote;
  306.   BEGIN
  307.     PutWindow(wInfoNote);
  308.  
  309.     WITH wInfoNote DO BEGIN
  310.       winX1 :=  2;
  311.       winX2 :=  6;
  312.       winX3 :=  9;
  313.       winX4 := 16;
  314.       winX5 := 23;
  315.       PutRotulo (ParseCoords(x+ 1, y), 'note', BYTE(col[2]));
  316.       PutRotulo (ParseCoords(x+ 6, y), 'vl',   BYTE(col[2]));
  317.       PutRotulo (ParseCoords(x+11, y), 'reps', BYTE(col[2]));
  318.       PutRotulo (ParseCoords(x+18, y), 'repl', BYTE(col[2]));
  319.       PutRotulo (ParseCoords(x+26, y), 'len',  BYTE(col[2]));
  320.       RectAttr  (ParseCoords(x+ 2, y+1), 3, 16, BYTE(col[3]));
  321.       RectAttr  (ParseCoords(x+ 6, y+1), 2, 16, BYTE(col[3]));
  322.       RectAttr  (ParseCoords(x+ 9, y+1), 6, 16, BYTE(col[3]));
  323.       RectAttr  (ParseCoords(x+16, y+1), 6, 16, BYTE(col[3]));
  324.       RectAttr  (ParseCoords(x+23, y+1), 6, 16, BYTE(col[3]));
  325.     END;
  326.   END;
  327.  
  328.  
  329. PROCEDURE InitWinPlayBars;
  330.   VAR
  331.     i, j : WORD;
  332.   BEGIN
  333.     PutWindow(wPlayBars);
  334.  
  335.     WITH wPlayBars DO BEGIN
  336.       vis  := FALSE;
  337.       forz := FALSE;
  338.       act  := FALSE;
  339.  
  340.       FOR i := 1 TO 16 DO
  341.         FOR j := 1 TO 16 DO
  342.           DirectWriteAttr(ParseCoords(x+j, y+i), Barval, BYTE(col[1]));
  343.     END;
  344.   END;
  345.  
  346.  
  347. PROCEDURE InitWinPanning;
  348.   VAR
  349.     i : WORD;
  350.   BEGIN
  351.     PutWindow(wPanning);
  352. {
  353.     WITH wPanning DO BEGIN
  354.       FOR i := 1 TO 16 DO
  355.         IF Odd(i SHR 1) THEN
  356.           DirectWriteAttr(ParseCoords(x+1, y+i), '⌡÷⌡⌡⌡⌡', BYTE(col[1]))
  357.         ELSE
  358.           DirectWriteAttr(ParseCoords(x+1, y+i), '⌡⌡⌡⌡≈⌡', BYTE(col[1]));
  359.     END;
  360. }
  361.   END;
  362.  
  363.  
  364. PROCEDURE InitWinVoiceOnOff;
  365.   BEGIN
  366.     PutWindow(wVoiceOnOff);
  367.   END;
  368.  
  369.  
  370. PROCEDURE InitWin2ndLine;
  371.   BEGIN
  372.     InitWinChannelNum;
  373.     InitWinRunSample;
  374.     InitWinInfoNote;
  375.     InitWinPlayBars;
  376.     InitWinPanning;
  377.     InitWinVoiceOnOff;
  378.   END;
  379.  
  380. {
  381.  
  382. PROCEDURE InitOscilloscInfo;
  383.   CONST
  384.     EmptyStr : STRING[51] = '                                                   ';
  385.     OscView  : STRING[30] = '';
  386.     i        : WORD       = 0;
  387.     j        : WORD       = 0;
  388.     ofs      : WORD       = 0;
  389.   VAR
  390.     OscWinBuff    : ARRAY[1..16, 1..51*2] OF CHAR;
  391.   BEGIN
  392.     OscView := GetString(StrOscilloscView);
  393.     WITH wOscillosc DO BEGIN
  394.       FOR i := 1 TO 16 DO PutStr(OscWinBuff[i], EmptyStr, BYTE(col[1]));
  395.       PutStr(OscWinBuff[1][21*2-1], OscView, BYTE(col[1]));
  396.       FOR i := 3 TO 14 DO BEGIN
  397.         OscWinBuff[i][4] := col[1];
  398.         OscWinBuff[i][6] := col[1];
  399.         OscWinBuff[i][8] := col[1];
  400.         OscWinBuff[i][3] := ' ';
  401.         OscWinBuff[i][5] := ' ';
  402.         OscWinBuff[i][7] := #131;
  403.         FOR j := 5 TO 50 DO BEGIN
  404.           OscWinBuff[i][j*2]   := col[2];
  405.           OscWinBuff[i][j*2-1] := #0;
  406.         END;
  407.       END;
  408.       OscWinBuff[15][8] := col[1];
  409.       OscWinBuff[15][7] := #150;
  410.       FOR j := 5 TO 50 DO BEGIN
  411.         OscWinBuff[15][j*2]   := col[1];
  412.         OscWinBuff[15][j*2-1] := #148;
  413.       END;
  414.  
  415.       Ofs := ParseCoords(x+1, y+1);
  416.       FOR i := 1 TO 16 DO BEGIN
  417.         Move(OscWinBuff[i], Ptr(ScrSegment, Ofs)^, SIZEOF(OscWinBuff[1]));
  418.         INC(Ofs, ScreenBytesX);
  419.       END;
  420.     END;
  421.   END;
  422.  
  423. }
  424.  
  425. PROCEDURE InitWinMenus;
  426.   BEGIN
  427.     PutWindow(wMenus);
  428.   END;
  429.  
  430.  
  431. PROCEDURE InitWinOscillosc;
  432.   VAR
  433.     i : WORD;
  434.   BEGIN
  435.     PutWindow(wOscillosc);
  436.  
  437.     WITH wOscillosc DO BEGIN
  438.       DirectWrite(ParseCoords(x+39, y+1), GetString(StrOscilloscView));
  439. {
  440.       FOR i := 3 TO 14 DO
  441.         DirectWrite(ParseCoords(x+4, y+i),  #131);
  442.       DirectWrite  (ParseCoords(x+4, y+15), #150);
  443.       FOR i := 5 TO 50 DO
  444.         DirectWrite(ParseCoords(x+i, y+15), #148);
  445. }
  446.     END;
  447.   END;
  448.  
  449.  
  450. PROCEDURE InitWinSamples;
  451.   BEGIN
  452.     PutWindow(wSamples);
  453.     PutWindow(wSamples1);
  454.     PutWindow(wSamples2);
  455.     PutWindow(wSamples3);
  456.   END;
  457.  
  458.  
  459. PROCEDURE InitWinPart;
  460.   VAR
  461.     i : WORD;
  462.   BEGIN
  463.     PutWindow(wPartSmall);
  464.     PutWindow(wPartPastIdx);
  465.     PutWindow(wPartActIdx);
  466.     PutWindow(wPartFutIdx);
  467.     FOR i := 1 TO 4 DO BEGIN
  468.       PutWindow(wPartPast[i]);
  469.       PutWindow(wPartAct[i]);
  470.       PutWindow(wPartFut[i]);
  471.       WITH wPartPast[i] DO BEGIN
  472.         PutRotulo(ParseCoords(x+5,                               y), GetString(StrChannel), BYTE(col[4]));
  473.         PutRotulo(ParseCoords(x+5+Length(GetString(StrChannel)), y), CHAR(i+ORD('0')),      BYTE(col[4]));
  474.       END;
  475.     END;
  476.   END;
  477.  
  478.  
  479. PROCEDURE InitWinBigPart;
  480.   VAR
  481.     i : WORD;
  482.   BEGIN
  483.     PutWindow(wPartBig);
  484.     PutWindow(wPartPastBIdx);
  485.     PutWindow(wPartActBIdx);
  486.     PutWindow(wPartFutBIdx);
  487.     FOR i := 1 TO 4 DO BEGIN
  488.       PutWindow(wPartPastBig[i]);
  489.       PutWindow(wPartActBig[i]);
  490.       PutWindow(wPartFutBig[i]);
  491.       WITH wPartPastBig[i] DO BEGIN
  492.         PutRotulo(ParseCoords(x+5,                               y), GetString(StrChannel), BYTE(col[4]));
  493.         PutRotulo(ParseCoords(x+5+Length(GetString(StrChannel)), y), CHAR(i+ORD('0')),      BYTE(col[4]));
  494.       END;
  495.     END;
  496.   END;
  497.  
  498.  
  499. PROCEDURE InitWinCredits;
  500.   VAR
  501.     i : WORD;
  502.   BEGIN
  503.     PutWindow(wCredits);
  504.  
  505.     WITH wCredits DO BEGIN
  506.       DirectWriteAttr(ParseCoords  (x+10, y+   2), GetString(StrCreditsTitle), BYTE(col[3]));
  507.  
  508.       i := 0;
  509.       WHILE GetString(StrCredits + i) <> #0 DO
  510.         BEGIN
  511.           DirectWriteAttr(ParseCoords(x+10, y+i+ 4), GetString(StrCredits + i), BYTE(col[1]));
  512.           INC(i);
  513.         END;
  514.  
  515.       i := 0;
  516.       WHILE GetString(StrDedicat + i) <> #0 DO
  517.         BEGIN
  518.           DirectWriteAttr(ParseCoords(x+10, y+i+38), GetString(StrDedicat + i), BYTE(col[2]));
  519.           INC(i);
  520.         END;
  521.     END;
  522.  
  523.   END;
  524.  
  525.  
  526.  
  527.  
  528. PROCEDURE InitScreen;
  529.   VAR
  530.     i, j : WORD;
  531.     s    : STRING;
  532.   BEGIN
  533.  
  534.     InitWinScreen;
  535.     InitWinTopLine;
  536.     InitWin2ndLine;
  537.     InitWinSamples;
  538.     InitWinPart;
  539.  
  540.   END;
  541.  
  542.  
  543.  
  544. PROCEDURE RefreshMiscInfo(VAR Song: TSong);
  545.   VAR
  546.     s : STRING;
  547.     t : STRING;
  548.     u : STRING;
  549.     i : WORD;
  550.   BEGIN
  551.     WITH wMiscInfo DO BEGIN
  552.       DirectWriteAttr(ParseCoords(x+wmiX1, y+1), Song.GetName,               BYTE(col[2]));
  553.       DirectWriteAttr(ParseCoords(x+wmiX1, y+2), Song.FileName+Song.FileExt, BYTE(col[2]));
  554.       DirectWriteAttr(ParseCoords(x+wmiX2, y+2), Song.GetInsidePath,         BYTE(col[2]));
  555.       STR(Heap.HMaxAvail,    s);
  556.       STR(Heap.HMemAvail,    t);
  557.       STR(UmbHeap.HMemAvail, u);
  558.                                                  {xxxxx (xxxxx) | xxxxxx}
  559.       DirectWriteAttr(ParseCoords(x+wmiX1, y+3), '                      ', BYTE(col[2]));
  560.       DirectWriteAttr(ParseCoords(x+wmiX1, y+3), t+' ('+s+') | '+u,        BYTE(col[2]));
  561.  
  562. (*
  563.       IF SoundHz >= 500 THEN
  564.         STR(SoundHz + 50 - ((SoundHz + 50) MOD 100), s)
  565.       ELSE
  566.         s := 'FallB';
  567.       DirectWriteAttr(ParseCoords(x+wmiX1, y+4), '     ',                  BYTE(col[2]));
  568.       DirectWriteAttr(ParseCoords(x+wmiX1, y+4), s,                        BYTE(col[2]));
  569. *)
  570.  
  571.       STR(UserVols[1] : 3, s);
  572.       DirectWriteAttr(ParseCoords(x+wmiX3, y+4), s,                        BYTE(col[2]));
  573.     END;
  574.  
  575.   END;
  576.  
  577.  
  578.  
  579.  
  580. PROCEDURE SaveInstrument(Name: STRING; Buf: POINTER; Len: WORD);
  581.   VAR
  582.     St : TDosStream;
  583.   BEGIN
  584.     St.Init(Name, stCreate);
  585.     St.Write(Buf^, Len);
  586.     St.Done;
  587.   END;
  588.  
  589. PROCEDURE InitSampleWin(VAR Song: TSong);
  590.   CONST
  591.     s     : STRING      = '';
  592.     i     : WORD        = 0;
  593.     Instr : PInstrument = NIL;
  594.   BEGIN
  595.     wsX1 := 4;
  596.  
  597.     WITH wSamples1 DO
  598.       FOR i := 1 TO 20 DO BEGIN
  599.         STR(i : 2, s);
  600.         DirectWriteAttr   (ParseCoords(x+1,    y+i), s,                      BYTE(col[3]));
  601.         Instr := Song.GetInstrument(i);
  602.         IF Instr = NIL THEN
  603.           DirectWriteAttr (ParseCoords(x+wsX1, y+i), '                         ', BYTE(col[2]))
  604.         ELSE IF Instr^.Instr = NIL THEN
  605.           DirectWriteAttr (ParseCoords(x+wsX1, y+i), Instr^.GetName,         BYTE(col[2]))
  606.         ELSE
  607.           DirectWriteAttr (ParseCoords(x+wsX1, y+i), Instr^.GetName,         BYTE(col[3]));
  608.       END;
  609.  
  610.     WITH wSamples2 DO
  611.       FOR i := 21 TO 40 DO BEGIN
  612.         STR(i : 2, s);
  613.         DirectWriteAttr   (ParseCoords(x+1,    y+i-20), s,                      BYTE(col[3]));
  614.         Instr := Song.GetInstrument(i);
  615.         IF Instr = NIL THEN
  616.           DirectWriteAttr (ParseCoords(x+wsX1, y+i-20), '                         ', BYTE(col[2]))
  617.         ELSE IF Instr^.Instr = NIL THEN
  618.           DirectWriteAttr (ParseCoords(x+wsX1, y+i-20), Instr^.GetName,         BYTE(col[2]))
  619.         ELSE
  620.           DirectWriteAttr (ParseCoords(x+wsX1, y+i-20), Instr^.GetName,         BYTE(col[3]));
  621.       END;
  622.  
  623.     WITH wSamples3 DO
  624.       FOR i := 41 TO 60 DO BEGIN
  625.         STR(i : 2, s);
  626.         DirectWriteAttr   (ParseCoords(x+1,    y+i-40), s,                      BYTE(col[3]));
  627.         Instr := Song.GetInstrument(i);
  628.         IF Instr = NIL THEN
  629.           DirectWriteAttr (ParseCoords(x+wsX1, y+i-40), '                         ', BYTE(col[2]))
  630.         ELSE IF Instr^.Instr = NIL THEN
  631.           DirectWriteAttr (ParseCoords(x+wsX1, y+i-40), Instr^.GetName,         BYTE(col[2]))
  632.         ELSE
  633.           DirectWriteAttr (ParseCoords(x+wsX1, y+i-40), Instr^.GetName,         BYTE(col[3]));
  634.       END;
  635.  
  636.   END;
  637.  
  638.  
  639.  
  640.  
  641. PROCEDURE RefreshModuleInfo(VAR Song: TSong);
  642.   VAR
  643.     s : STRING;
  644.     i : WORD;
  645.   BEGIN
  646.  
  647.     WITH wRunInfo DO BEGIN
  648.       STR(Song.SequenceLength   : 3, s); DirectWrite(ParseCoords(x+wriX2, y+1), s);
  649.       STR(Song.Patterns.Count   : 3, s); DirectWrite(ParseCoords(x+wriX2, y+2), s);
  650.       s := '   ';
  651.       DirectWrite(ParseCoords(x+wriX1, y+1), s);
  652.       DirectWrite(ParseCoords(x+wriX1, y+2), s);
  653.       DirectWrite(ParseCoords(x+wriX1, y+3), s);
  654.       DirectWrite(ParseCoords(x+wriX1, y+4), s);
  655.     END;
  656.  
  657.     RefreshMiscInfo(Song);
  658.  
  659.     InitSampleWin(Song);
  660.   END;
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668. {
  669. VAR
  670.   BIOSScrOffset : WORD ABSOLUTE 0:$44E;
  671. }
  672. BEGIN
  673.  
  674.   pwAttr    := BYTE(wScreen.col[2]);
  675. {  ScrOffset := BIOSScrOffset;}
  676.  
  677. END.
  678.